package pl.edu.agh.jemo.conf.types;

import java.util.ArrayList;
import java.util.List;

import pl.edu.agh.jemo.evolution.selections.Tournament;
import pl.edu.agh.jemo.evolution.selections.impl.BinaryTournament;
import pl.edu.agh.jemo.evolution.selections.impl.ClassicTournament;
import pl.edu.agh.jemo.evolution.selections.impl.EmptyTournament;

/**
 * Class dedicated to list all available selection types.
 * It is used by user interface, in order to help user choosing a selection to be used by algorithm.
 * 
 * @author Marcin.Zbijowski
 *
 */
public class SelectionTypesHandler {
	
	/**
	 * Returns collection of all available implemented selections in jemo.
	 * Returned object is java.util.List, containing references to classes being implementation of Tournament interface.
	 * This method should be updated when adding new selection operators.
	 * 
	 * Note that NSGA2 and SPEA2 specific tournaments has not been added to collection, as they cannot be used by general algorithm, only NSGA2, or SPEA2 implementations.
	 * 
	 * @return List of objects representing classes of available tournaments
	 */
	public static List<PrintableType<? extends Tournament>> getTournamentTypes() {
		List<PrintableType<? extends Tournament>> classes = new ArrayList<PrintableType<? extends Tournament>>();
		classes.add(new PrintableType<BinaryTournament>(BinaryTournament.class, "Binary tournament"));
		classes.add(new PrintableType<ClassicTournament>(ClassicTournament.class, "Classic tournament"));
		classes.add(new PrintableType<EmptyTournament>(EmptyTournament.class, "Empty tournament"));
		return classes;
	}
}
